package com.wolfpire.workflow.dao;

import java.util.List;
import java.util.Map;

import com.wolfpire.system.common.base.dao.IBaseHibernateDao;
import com.wolfpire.workflow.om.ProInstance;

public interface ProInstanceDao extends IBaseHibernateDao<ProInstance, Long> {
	public ProInstance getProByNameId(final String nameId);

	/**
	 * 根据实例ID获取实例信息
	 * @param instanceId
	 * @return 
	 */
	public ProInstance getProByInstanceId(final Long instanceId);
	
	/**
	 * 根据实例ID获取实例信息
	 * @param instanceId
	 * @return
	 */
	public Map<String, Object> getProMapByInstanceId(final Long instanceId);

	public List<Map<String, Object>> queryStatisticalList(final String wftypeId);

	/**
	 * 根据流程名称查流程
	 * @param proName
	 * @return
	 */
	public List<Map<String, Object>> queryStatisticalListByProName(String proName);
	
	public List<Map<String, Object>> queryListByNotTimeOut();
	
	public int countProInstanceTimeout(final String timeout);
	
	public int countSubInstancesByParentIdAndStatus(Long parentId, String status);
	
	public void updateCombination(String instanceIds);
	
	public List<Map<String, Object>> queryCombinationInstance(String combinationDemandIds,String formType);
	
	public Map<String, Object> getInstance(String formId,String formTypeId);
	
	public List<Map<String, Object>> querysubInstance(String parentId,
			String formTypeId, String startTime, String endTime);
	
	public List<Map<String, Object>> querysubInstance(String taskId);
	public void invalidInstance(String instanceId);
	
	public ProInstance getProByFormId(Long formId, Long formTypeId);

}
